import { createApp } from 'vue'
import {createRouter, createWebHashHistory} from 'vue-router'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '../public/index.css'
import axios from 'axios'
import ServiceList from './components/ServiceList/ServiceList.vue'
import RegistryCenter from './components/RegistryCenter/RegistryCenter.vue'
import InterfaceTest from './components/InterfaceTest/InterfaceTest.vue'
import AutoTest from './components/AutoTest/AutoTest.vue'

axios.defaults.baseURL = 'http://127.0.0.1:8081';

const app = createApp(App);

// ElementUI
app.use(ElementPlus);

// Router
const routes = [
  { path: '/', component: ServiceList },
  { path: '/servicelist', component: ServiceList },
  { path: '/registrycenter', component: RegistryCenter },
  { path: '/interfacetest', component: InterfaceTest },
  { path: '/autotest', component: AutoTest }
]

const router = createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
})
app.use(router);
app.mount('#app');


